<?php

require __DIR__ . '/../vendor/autoload.php';

$app = require_once __DIR__ . '/../bootstrap/app.php';

$app->make(\App\Console\Kernel::class)->bootstrap();

/* ============== Write Codes Below ================= */

echo '>>> Start Laravel from CLI' . PHP_EOL;

//$privatePath = base_path('SdPay/hezhi.pfx');
//$privatePass = 'hzkj2022';
$privatePath = base_path('SdPay/sand_test.pfx');
$privatePass = '123456';

$file = file_get_contents($privatePath);
if (!$file) {
    throw new \Exception('loadPk12Cert::file
            _get_contents');
}
if (!openssl_pkcs12_read($file, $cert, $privatePass)) {
    throw new \Exception('loadPk12Cert::openssl_pkcs12_read ERROR');
}
dd($cert['pkey']);
